package data;

import com.mongodb.DB;
import com.mongodb.DBCollection;
import com.mongodb.Mongo;
import com.mongodb.MongoException;
import java.net.UnknownHostException;

public class Data {
	static Mongo m = null;

	public static DBCollection data(String name) {
		if (m == null) {
			try {
				m = new Mongo("184.107.73.14");
			} catch (UnknownHostException e) {
				e.printStackTrace();
			} catch (MongoException e) {
				e.printStackTrace();
			}
		}
		DB db = m.getDB("wordpress");

		DBCollection coll = db.getCollection(name);
		return coll;
	}
}